# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libmicrohttpd
pkgver=0.9.71
pkgrel=0
pkgdesc="A small C library that is supposed to make it easy to run an HTTP server as part of another application."
url="https://www.gnu.org/software/libmicrohttpd/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="autoconf automake curl-dev gettext-dev gnutls-dev libgcrypt-dev libtool"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-$pkgver.tar.gz
	disable-test_options.patch
	"

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--enable-largefile \
		--enable-curl \
		--enable-https \
		--enable-messages
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 "$builddir"/src/include/platform.h \
		"$pkgdir"/usr/include/platform.h
}

sha512sums="dab92c0979f8016844970ce4e110469e608e2e15b4096cf518350541248f123e40a4c0289ba025302e318e0bf47a957e9a3dcdee6f55936504b6c1c4f02efb86  libmicrohttpd-0.9.71.tar.gz
c064757b8d0c88aaaa9104463bbcdabf1055e3c8054f98091699b39a094c50146e994c0fb24d6c619ea0ad559245560cd3460b6b9085f7d4249877e88ffb32e7  disable-test_options.patch"
